import { Component, OnInit } from '@angular/core';
import { finalize, tap } from 'rxjs/operators';
import { SystemService } from 'src/app/service/system.service';

@Component({
  selector: 'app-person-center',
  templateUrl: './person-center.component.html',
  styleUrls: ['./person-center.component.scss']
})
export class PersonCenterComponent implements OnInit {

  userInfo: any = {};
  pageloading = false;

  constructor(
    private systemService: SystemService,
  ) { }

  ngOnInit(): void {
    this.pageloading = true;
    this.systemService.userInfo().pipe(
      tap(res => {
        if (res.code === 200) {
          this.userInfo = res.data;
        }
      }),
      finalize(() => {
        this.pageloading = false;
      })
    ).subscribe();
  }

}
